import "express-async-errors";
import { ErrorRequestHandler } from 'express';
import { Response } from "./response";

export const ErrorMiddleware: ErrorRequestHandler = (error, req, res: Response, next) => {
  const message = error.message || error || '全局异常捕获';
  console.error(message);
  res.handleError!(error)
};
